<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<RMH.Entities.Patient>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Details
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div style="float: right">
        <form action="/Stay/New/" method="post">
        <input type="hidden" name="id" value="<%=Model.Id %>" />
        <button type="submit">
            New Stay</button>
        </form>
    </div>
    <h2>
        Patient Details -
        <%= Html.Encode(Model.LastName) + ", " + Html.Encode(Model.FirstName) %></h2>
    <h3>
        Patient Info:</h3>
    <table border="0" cellspacing="0">
        <tr>
            <td>
                <label for="FirstName">
                    First Name:</label>
            </td>
            <td>
                <%= Html.Encode(Model.FirstName) %>
            </td>
            <td>
                <label for="MiddleName">
                    Middle Name:</label>
            </td>
            <td>
                <%= Html.Encode(Model.MiddleName) %>
            </td>
        </tr>
        <tr>
            <td>
                <label for="LastName">
                    Last Name:</label>
            </td>
            <td>
                <%= Html.Encode(Model.LastName) %>
            </td>
            <td colspan="2">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <label for="DateOfBirth">
                    Date of Birth:</label>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:D}", Model.DateOfBirth)) %>
            </td>
            <td>
                <label for="DateOfDeath">
                    Date of Death:</label>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:D}", Model.DateOfDeath)) %>
            </td>
        </tr>
        <tr>
            <td>
                <label>
                    County</label>
            </td>
            <td>
                <%= Html.Encode(ViewData["CountyName"]) %>
            </td>
            <td>
                <label for="EmailAddress">
                    Email Address:</label>
            </td>
            <td>
                <%= Html.Encode(Model.EmailAddress) %>
            </td>
        </tr>
        <tr>
            <td>
                <label for="PhoneNumber">
                    Phone Number:</label>
            </td>
            <td>
                <%= Html.Encode(Model.PhoneNumber) %>
            </td>
            <td>
                <label for="PhoneNumberAlternate">
                    Alt. Phone Number:</label>
            </td>
            <td>
                <%= Html.Encode(Model.PhoneNumberAlternate) %>
            </td>
        </tr>
    </table>
    <%Html.RenderPartial("_SupportPersonSummary", Model.Relationships); %>
    <h3>
        Address:</h3>
    <table>
        <tr>
            <td>
                <label for="AddressStreet1">
                    Street Address:</label>
            </td>
            <td>
                <%= Html.Encode(Model.Address == null ? null : Model.Address.Street1) %>
            </td>
            <td>
                <label for="AddressCity">
                    City:</label>
            </td>
            <td>
                <%= Html.Encode(Model.Address == null ? null : Model.Address.City)%>
            </td>
        </tr>
        <tr>
            <td>
                <label for="AddressStreet2">
                    Additional Address 1:</label>
            </td>
            <td>
                <%= Html.Encode(Model.Address == null ? null : Model.Address.Street2)%>
            </td>
            <td>
                <label for="AddressState">
                    State:</label>
            </td>
            <td>
                <%= Html.Encode(Model.Address == null ? null : Model.Address.State)%>
            </td>
        </tr>
        <tr>
            <td>
                <label for="AddressStreet3">
                    Additional Address 2:</label>
            </td>
            <td>
                <%= Html.Encode(Model.Address == null ? null : Model.Address.Street3)%>
            </td>
            <td>
                <label for="AddressPostalCode">
                    Postal Code:</label>
            </td>
            <td>
                <%= Html.Encode(Model.Address == null ? null : Model.Address.PostalCode)%>
            </td>
        </tr>
    </table>
    <h3>
        Vehicle Info</h3>
    <table>
        <tr>
            <td>
                <label for="VehicleMake">
                    Vehicle Make:</label>
            </td>
            <td>
                <%= Html.Encode(Model.VehicleMake) %>
            </td>
            <td>
                <label for="VehicleModel">
                    Vehicle Model:</label>
            </td>
            <td>
                <%= Html.Encode(Model.VehicleModel) %>
            </td>
        </tr>
        <tr>
            <td>
                <label>
                    Vehicle Plate</label>
            </td>
            <td colspan="3">
                <%= Html.Encode(Model.VehiclePlateState) + " " + Html.Encode(Model.VehiclePlateNumber) %>
            </td>
        </tr>
    </table>
    <h3>Diagnoses</h3>
    <% foreach (var item in Model.Diagnoses) { %>
        <p>  <%= Html.Encode(item.Name) %></p>
    <% } %>
    
    <%Html.RenderPartial("_Notes", Model); %>   
    <p>
        <%=Html.ActionLink("Edit", "Edit", new { id=Model.Id }) %>
        |
        <%=Html.ActionLink("Add Stay", "New", "Stay", new { id = Model.Id }, null)%>
        |
        <%=Html.ActionLink("Add Notes", "Notes", new { id=Model.Id }) %>
        |
        <%=Html.ActionLink("Back to List", "Index") %>
    </p>
</asp:Content>
